package com.fancy.controller;

import com.fancy.pojo.category.Album;
import com.fancy.service.AlbumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/album")
public class AlbumController {

    @Autowired
    AlbumService albumService;

    @RequestMapping("/selectMusicByAlbumId/{id}")
    public Album selectMusicByAlbumId(@PathVariable("id") Integer id){
        return albumService.selectAlbumByAlbumId(id);
    }

    @RequestMapping("/selectAllAlbum")
    public List<Album> selectAlbum(){
        return albumService.selectAlbumById();
    }
}
